home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_u_z / vxb102.zip / VXBTEST.ZIP / VXFORM1.FRM (.txt) < prev    next >
Visual Basic Form  |  1991-12-03  |  19KB  |  486 lines

  1. VXFORM1
  2. 4vxBase Sample Application: Aircraft Brokerage System
  3. Form1
  4. Picture1
  5. DDDK0
  6. DKDK0
  7. DKDK0
  8. Label1
  9. vxBase Sample Application
  10. Tms Rmn
  11. FileMenu
  12. &File
  13. s    OpenTypes
  14. &Types
  15. OpenCust
  16. &Customers
  17. OpenAircraft
  18.     &Aircraft
  19. SepBar
  20. ExitCode
  21. LinkMenu
  22. &Link
  23. LinkBuyToSell
  24. &Buyer to Sellers
  25. LinkSellToBuy
  26. &Seller to Buyers
  27. {    MaintMenu
  28. &Maintenance
  29. |    PackFiles
  30. &Pack
  31. TestMenu
  32. &Test
  33. TestCreate
  34. &Create
  35. TestCopy
  36. Copy &Structure
  37. TestDataCopy
  38. Copy &Data
  39.     FileStruc
  40. &File Structure
  41. Label1_Click\
  42. FileOpen_Click
  43. DbfRef/
  44. vxUseDbf
  45. NtxRefJ
  46. vxUseNtxZ
  47. FALSE
  48. vxCloseAll
  49. vxTopu
  50. Text1
  51. textm
  52. Text2|
  53. vxRecNo
  54. Text3
  55. vxDouble8
  56. Command1_Clickg
  57. vxSkip
  58. vxEof
  59. Command2_ClickY
  60. ExitCode_Click
  61. RecNo
  62. TRUEh
  63. CurrVc
  64. FldName.
  65. CurrAmtx
  66. EndFi
  67. DbfArea
  68. SkipCommand_Click>
  69. Text4
  70. vxField
  71. FileBrowse_Click
  72. vxBrowse
  73.     BrowseRet5
  74. Text5m
  75. VXFORM1P
  76. hWndD
  77. BROWSE_CLOSED
  78. BROWSE_EDIT
  79. BROWSE_ADD~
  80. BROWSE_DELETE
  81. Enabled
  82. BROWSE_ERROR
  83. BrowseActiveS
  84. Form_Clickr
  85. Label16
  86. Caption
  87. FileJoin_Click
  88. Cluser
  89.     CluserNtx?
  90. ClprodJ
  91.     ClprodNtxK
  92. TableDeclare
  93. ColorRef%
  94. VX_RED1
  95. TableField
  96. VX_FIELD
  97. TabelFieldr
  98. VX_BLUEC
  99. vxSelectDbf
  100. vxSelectNtx
  101. vxJoin
  102. vxTableDeclareK
  103. vxTableField
  104. vxTableReset
  105. vxJoinReset}
  106. vxClose}
  107. vxSelect
  108. Text1_Change
  109. Form_Unload<
  110. Cancel
  111. FileMenu_Click
  112. OpenAircraft_Click
  113. OpenTypes_Click
  114. TypeReturn
  115. AirtypesDbf
  116. AirTypesNtx
  117.     TypeStartk
  118. VXFORM0
  119. VXFORM2
  120. Visible
  121. ThenCancel$
  122. BrowseTypes1
  123. OpenCust_Click
  124. AircustDbf
  125. Aircust1Ntx
  126. Aircust2Ntx
  127. Aircust3Ntx
  128. AirstateDbf
  129. Airstat1Ntx.
  130. Airstat2NtxU
  131. AirbuyerDbf<
  132. Airbuy1Ntxd
  133. Airbuy2Ntxh
  134. VX_GRAY
  135. AircraftDbfs
  136. Aircraf1Ntx
  137. Aircraf2Ntx
  138. VX_GREEN
  139. there
  140. active1
  141. browseC
  142. windows
  143. table
  144. allow
  145. BrowseCust
  146. AirCust
  147. LinkBuyToSell_Click
  148. StatesOpen
  149. AircraftOpen
  150.     TypesOpen
  151.     brokerage
  152.     customers
  153. fileB    
  154.     BrowseAir
  155.     BuyerOpent
  156. BofExprY
  157. EofExpr6
  158. VX_EXPR
  159.     BuyReturnb
  160. BuyerReturn
  161. LinkSellToBuy_Click
  162. Demonstration
  163. setting
  164. visual
  165. relationships
  166. AircraftReturn
  167. TestCreate_Click
  168. CustFile[
  169.     FileStruc
  170.     NumFields
  171. Fld01
  172. Fld02
  173. Fld03[    
  174. Fld04
  175. Fld05
  176. vxCreate
  177. TypeFiler
  178. TypeDbfN    
  179. vxCreateNtx
  180. TypeNtx
  181. vxAppendFrom
  182. NewRet
  183. vxCreateDbf
  184. PackFiles_Click
  185. vxPackR
  186. TestCopy_Click
  187. NtxExpr
  188. MaintMenu_Click
  189.     vxNtxExpr3    
  190. vxCopyStruc
  191. TestDataCopy_Click
  192. vxCopy
  193. vxDeleteRange
  194. DbfName&    
  195.     vxDbfName
  196. StartRec
  197. EndRec
  198. vxEmpty
  199.     vxExactOnI
  200. vxSeek
  201. vxFoundr    
  202. vxExactOff
  203. FileStruc_Click
  204. VXFORM7d    
  205. vxNtxDeselect
  206. NtxName
  207.     vxNtxName
  208. vxDeleteRec$
  209. vxRecallq
  210.     vxReindex
  211. vxZap
  212. vxSeekSoft?
  213.     vxAreaDbf
  214. Form_Painth
  215. vxFormGray
  216. vxFormFrame
  217. vxCtlGrayReset4
  218. every
  219. database
  220. OpenCust
  221. OpenAircraft
  222. LinkBuyToSell
  223. LinkSellToBuy
  224.     PackFiles
  225. TestCreateO
  226. TestDataCopy
  227. TestCopy
  228.     OpenTypes
  229. which
  230. updates
  231. CanClose
  232. VXFORM3
  233. VXFORM4,
  234. VXFORM5
  235. VXFORM6
  236. Form2Active
  237. Form3Active
  238. Form4Active
  239. Form5Active
  240. Form6Active
  241. Form7Active
  242. Form_GotFocusA
  243.     disabling
  244. vxUnlock
  245. ExitCode_Click
  246.  The master form VXFORM1 is unloaded.
  247.  The Form_Unload procedure does then
  248.  final cleanup.a
  249. Form_Unload
  250.  This routine is activated from either the
  251.  Exit menu item on VXFORM1 or by selecting
  252.  the Close item from the system menu. 
  253.  We MUST test the vxCloseAll result in
  254.  case there are any active browse windows-
  255.  that require closure before we cani
  256.  terminate the application
  257.  If the close operation is successful, any
  258.  open databases FOR THIS TASK are closed
  259.  (which updates the database header information)
  260.  and all attached memory objects (Tables and Joins)s
  261.  are released.
  262.  if any of our other forms are active, we
  263.  cannot close this form and exit the app
  264. Sub forms must be closed first
  265.  redraw top level form
  266.  NOTE: we cannot use the FORM.Visible property toy
  267.  check if any forms are active because as soon asn
  268.  we reference a form, it gets loaded - and our app
  269.  will stall with No Database messages because as soons
  270.  as the form is loaded, the database attached to thatt
  271.  form is referencedd
  272.  redraw top level form
  273.  reset system disabled color
  274. OpenTypes_Click
  275.  in VXBMOD.BAS
  276.  start browse table(
  277.  in module file VXBMOD.BAS
  278. OpenCust_Click
  279.  open brokerage customers file
  280. \vb\vxbtest\aircust.dbf"
  281. Error Opening aircust.dbf. Aborting.
  282. \vb\vxbtest\aircust1.ntx
  283. \vb\vxbtest\aircust2.ntx
  284. \vb\vxbtest\aircust3.ntx
  285.  Declare Customer Tablen
  286. a_code
  287. a_name
  288. a_city
  289. State"
  290. a_state"
  291. Res Phone"
  292. a_phoneres
  293. Bus Phone"
  294. a_phonebus
  295.  open state abbreviations file
  296.  in VXBMOD.BAS
  297.  start browse tablee
  298.  in module VXMOD.BAS
  299. OpenAircraft_Click
  300.  both routines in VXBMOD.BAS
  301. LinkBuyToSell_Click
  302.  Demonstration of setting up visual relationshipsh
  303.  with the vxJoin command. What we have is a file of buyers
  304.  categorized by type of aircraft they are interested in.
  305.  What we are going to do is display a browse table ofe
  306.  these buyer records and link any buyer record tod
  307.  another browse table of aircraft that match the the
  308.  buyer aircraft type field.e
  309.  Conversely, the LinkSellToBuy proc does the opposite. It.
  310.  links the aircraft with all prospective buyers.
  311.  open file that will control the joinj
  312. \vb\vxbtest\airbuyer.dbf
  313. \vb\vxbtest\airbuy2.ntx"
  314.  this index is on aircraft typet
  315.  define table to show data we are interested ind
  316. b_cat"
  317. Description"
  318. left(b_desc,20)"
  319. b_low"
  320. b_high
  321. Customer
  322. b_code
  323.  now open secondary file and define its tablea
  324. \vb\vxbtest\aircraft.dbf
  325. Error Opening aircraft.dbf. Aborting."
  326. \vb\vxbtest\aircraf2.ntx
  327.  on type
  328. c_cat"
  329. c_code
  330. Price"
  331. c_price"
  332. c_year
  333. c_ttsn
  334.  reselect the master file and set up the joinj
  335. b_cat"
  336. Possible Sales#
  337.  this joins the Aircraft file using the index selected for
  338.  it to the buyer file. The "b_cat" param is the field we
  339.  will use as a key into the aircraft file and the VX_FIELD
  340.  item tells vxBase that it is a field and not an expression.
  341.  The last item in the call is a title for the join window.
  342.  disable menu items that might affect our displayp
  343.  now set up and execute the browse. The JOIN menu item ism
  344.  automatically enabled.l
  345. Buyer Details"
  346.  when we return from the browse we can ignore anything
  347.  vxBase sent back to us in the BuyerReturn param
  348.  we could get fancy and get the customer record if the
  349.  use hit enter and then display or edit it. Do
  350.  whatever you like.i
  351.  re-enable menu itemst
  352. LinkSellToBuy_Click
  353.  Browse the aircraft for sale file and join to
  354.  potential buyers. See a more detailed explanantion of
  355.  visual relationships in the LinkBuyToSell ProcP
  356.  open file that will control the join-
  357. \vb\vxbtest\aircraft.dbf
  358. Error Opening aircraft.dbf. Aborting."
  359. \vb\vxbtest\aircraf2.ntx
  360.  on type
  361.  define table to show data we are interested inF
  362. c_cat"
  363. Description"
  364. left(c_desc,20)"
  365. c_code
  366. Price"
  367. c_price"
  368. c_year
  369. c_ttsn
  370.  now open secondary file and define its table
  371. \vb\vxbtest\airbuyer.dbf
  372. Error Opening airbuyer.dbf. Aborting."
  373. \vb\vxbtest\airbuy2.ntx"
  374. b_cat"
  375. b_low"
  376. b_high
  377. Customer
  378. b_code
  379.  reselect the master file and set up the join 
  380. c_cat"
  381. Possible Buyers"#
  382.  this joins the buyer file using the index selected for
  383.  it to the aircraft file. The "c_cat" param is the field we
  384.  will use as a key into the buyer file and the VX_FIELDd
  385.  item tells vxBase that it is a field and not an expression.
  386.  The last item in the call is a title for the join window.
  387.  disable menu itemst
  388.  now set up and execute the browse. The JOIN menu item is-
  389.  automatically enabled. 
  390. Aircraft Record Display"
  391.  when we return from the browse we can ignore anything
  392.  vxBase sent back to us in the BuyerReturn param
  393.  re-enable menu itemst
  394. TestCreate_Click
  395.  1234567890123456  (ruler to help alignment)
  396. CATEGORY  C  3 0
  397. CATNAME   C 15 0
  398.  our field length for the second field is shorterr
  399.  than the original file so when we appendfrom belowe
  400.  this field should be truncated and will show as
  401.  such in the browseo
  402. \vb\vxbtest\typefile.dbf
  403. Error in database creation
  404. \vb\vxbtest\typefile.dbf
  405.  index create opens and selects new index ande
  406.  returns the index select area. Zero (FALSE)
  407.  is returned if there was an error
  408. \vb\vxbtest\typefile.ntx
  409. category
  410. Error in index create"
  411. \vb\vxbtest\airtypes.dbf
  412. Error in append from
  413. New File
  414. \vb\vxbtest\typefile.dbf
  415. \vb\vxbtest\typefile.ntx
  416. PackFiles_Click
  417.  removes logically deleted records
  418.  and reindexes
  419. \vb\vxbtest\airtypes.dbf
  420. airtypes in use!
  421. \vb\vxbtest\airtypes.dbf
  422. \vb\vxbtest\airtypes.ntx
  423. \vb\vxbtest\aircust.dbf"
  424. aircust in use!"
  425. \vb\vxbtest\aircust.dbf"
  426. \vb\vxbtest\aircust1.ntx
  427. \vb\vxbtest\aircust2.ntx
  428. \vb\vxbtest\aircust3.ntx
  429. \vb\vxbtest\airbuyer.dbf
  430. airbuyer in use!
  431. \vb\vxbtest\airbuyer.dbf
  432. \vb\vxbtest\airbuy1.ntx"
  433. \vb\vxbtest\airbuy2.ntx"
  434. \vb\vxbtest\aircraft.dbf
  435. aircraft in use!
  436. \vb\vxbtest\aircraft.dbf
  437. \vb\vxbtest\aircraf1.ntx
  438. \vb\vxbtest\aircraf2.ntx
  439. TestCopy_Click
  440.  disable items that would be affected by
  441.  closure of airtypes filef
  442. \vb\vxbtest\airtypes.dbf
  443. \vb\vxbtest\airtypes.ntx
  444. \vb\vxbtest\testcopy.dbf
  445. Error in database copy struc
  446. \vb\vxbtest\testcopy.dbf
  447.  index create opens and selects new index ande
  448.  returns the index select area. Zero (FALSE)
  449.  is returned if there was an error
  450. \vb\vxbtest\testcopy.ntx
  451. Error in index create"
  452. \vb\vxbtest\airtypes.dbf
  453. Error in append from
  454. New File
  455. \vb\vxbtest\testcopy.dbf
  456. \vb\vxbtest\testcopy.ntx
  457. TestDataCopy_Click
  458. \vb\vxbtest\airtypes.dbf
  459. \vb\vxbtest\airtypes.ntx
  460. \vb\vxbtest\testdata.dbf
  461. Error in database copy
  462. \vb\vxbtest\testdata.dbf
  463.  Test delete range
  464. Error in DeleteRange
  465.  index create opens and selects new index and
  466.  returns the index select area. Zero (FALSE)
  467.  is returned if there was an error
  468. \vb\vxbtest\testdata.ntx
  469. Error in index create"
  470.  test ntx name function"
  471. \vb\vxbtest\testdata.dbf
  472.             Kill "\vb\vxbtest\testdata.ntx"
  473. FileStruc_Click
  474.  disable items that would be affected by
  475.  closing of aircust file
  476. Form_Paint
  477. Form_Click
  478.  test for active forms and set
  479.  menu items accordingly. We do this here
  480.  as well as when we start up our forms
  481.  because some functions allow otherr
  482.  functions to be active and when one or
  483.  the other is closed and menu items are
  484.  re-enabled, then we mess up our menur
  485.  disabling for the ones left open.
  486.